package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.map.HLLocationManager;

public class HLClassLocationManager extends HLLibClass {
    public HLClassLocationManager(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLLocationManager();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            if (resultOwnerObject == null) {
                ((HLLocationManager) self).StartUpdateLocation();
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLLocationManager) self).StartUpdateLocation());
            }
            break;
        }
        case 1: {
            ((HLLocationManager) self).StopUpdateLocation();
            break;
        }
        case 2: {
            ((HLLocationManager) self).SetDistance(args.GetInt(0));
            break;
        }
        }
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            if (resultOwnerObject == null) {
                HLLocationManager.IsLocationEnable();
            } else {
                resultOwnerObject.SetBoolean(resultIndex, HLLocationManager.IsLocationEnable());
            }
            break;
        }
        }
    }
}
